<template>
    <div>
      <!-- 触发按钮 -->
      <el-button @click="drawer = true">打开侧边栏</el-button>
  
      <!-- 侧边栏 -->
      <el-drawer
        title="侧边导航"
        :visible.sync="drawer"
        size="20%"
        @opened="handleOpen"
        @closed="handleClose"
      >
        <!-- 树形菜单 -->
        <el-menu :default-openeds="['1', '2', '3']">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-menu"></i>用户中心</template>
            <el-menu-item index="1-1">子系统1</el-menu-item>
            <el-menu-item index="1-2">子系统2</el-menu-item>
            <!-- 更多子菜单项 -->
          </el-submenu>
          <!-- 更多的 el-submenu 或 el-menu-item -->
        </el-menu>
      </el-drawer>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        // 控制侧边栏的显示
        drawer: false,
      };
    },
    methods: {
      handleOpen() {
        console.log('侧边栏打开');
      },
      handleClose() {
        console.log('侧边栏关闭');
      },
    },
  };
  </script>